home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol194 / msdefs.h < prev    next >
Encoding:
Text File  |  1986-11-25  |  9.6 KB  |  309 lines

  1. verdef    macro
  2.     db    ' Kermit-MS V2.28'
  3.     endm
  4.  
  5. BELL    EQU     07Q
  6. TAB     EQU     11Q
  7. LF      EQU     12Q
  8. FF      EQU     14Q
  9. CR      EQU     15Q
  10. XON     EQU     21Q
  11. XOFF    EQU     23Q
  12. ESC     EQU     33Q
  13. DEL     EQU     177Q
  14. BS    EQU    08H
  15. CTLZ    EQU    1AH
  16. SOH     EQU     01H             ; Start of header char.
  17.  
  18. DOS     EQU     21H
  19.  
  20. CONIN   EQU     01H
  21. CONOUT  EQU     02H
  22. RDRIN   EQU     03H
  23. PUNOUT  EQU     04H
  24. LSTOUT  EQU     05H
  25. DCONIO  EQU     06H
  26. CONINQ    EQU    07H        ; quiet console input
  27. PRSTR   EQU     09H
  28. CONSTAT EQU     0BH
  29. SELDSK    EQU    0EH        ; Select disk.
  30. OPENF   EQU     0FH
  31. CLOSF   EQU     10H
  32. SFIRST  EQU    11H
  33. SNEXT    EQU    12H
  34. DELF    EQU     13H
  35. READF   EQU     14H             ; Read from the file.
  36. WRITEF  EQU     15H
  37. MAKEF   EQU     16H
  38. GCURDSK    EQU    19H        ; Current disk.
  39. SETDMA    EQU    1AH
  40. PRSFCB    equ    29H        ; parse an fcb.
  41. DOSVER    equ    30H        ; dos version #
  42. OPEN2    EQU    3DH        ; 2.0 open
  43. CLOSE2    EQU    3EH        ; 2.0 close
  44. READF2    EQU    3FH        ; 2.0 read.
  45. LSEEK    EQU    42H        ; 2.0 lseek
  46. IOCTL    EQU    44H
  47. WRITEF2    EQU    40H        ; 2.0 write
  48. GCD    equ    47H        ; 2.0 get current directory.
  49. GSWITCH    EQU    37h        ; undocumented get/set switch character
  50. SETBLK    equ    4ah        ; modify allocated memory map
  51. ALLOC    equ    48h        ; allocate memory
  52. FREEMEM    equ    49h        ; free memory
  53. chdir    equ    3bh        ; change directory
  54. gettim    equ    2CH        ; Get the time of day. 
  55.  
  56.  
  57. PAREVN    EQU    00H        ; Even parity.
  58. PARMRK    EQU    01H        ; Mark parity.
  59. PARNON    EQU    02H        ; No parity.    
  60. PARODD    EQU    03H        ; Odd parity.
  61. PARSPC    EQU    04H        ; Space parity.
  62.  
  63. CMKEY   EQU     01H             ; Parse a keyword.
  64. CMIFI   EQU     02H             ; Parse an input file spec (can be wild).
  65. CMOFI   EQU     03H             ; Parse an output file spec.
  66. CMCFM   EQU     04H             ; Parse a confirm.
  67. CMTXT    EQU    05H        ; Parse arbitrary text up to CR.
  68.  
  69. FLOXON    EQU    1113H        ; Use XON/XOFF for flow control.
  70. FLONON    EQU    0        ; Don't do flow control.
  71. DEFHAND    EQU    XON        ; Use XON as default handshake.
  72.  
  73. DMASIZ    EQU    80H        ; Size of DMA.
  74. FCBSIZ    EQU    25H
  75.  
  76. MAXTAK    EQU    05H        ; Max number of TAKE's allowed.
  77. MAXTRY  EQU    05Q        ; Default number of retries on a packet.
  78. IMXTRY  EQU    20Q        ; Default number of retries send initiate.
  79.  
  80. DEFESC  EQU     ']'-100Q        ; The default escape character.
  81. DRPSIZ  EQU     94        ; Default receive packet size.
  82. DSPSIZ  EQU     94        ; Default send packet size.
  83. DSTIME  EQU     08H             ; Default send time out interval.
  84. DRTIME  EQU     0DH             ; Default receive time out interval.
  85. DSRVTM    EQU    30        ; Default server timeout.
  86. DSPAD   EQU     00H             ; Default send padding.
  87. DRPAD   EQU     00H             ; Default receive padding.
  88. DSPADC  EQU     00H             ; Default send padding char.
  89. DRPADC  EQU     00H             ; Default receive padding char.
  90. DSEOL   EQU     CR              ; Default send EOL char.
  91. DREOL   EQU     CR              ; Default receive EOL char.
  92. DSSOH    EQU    SOH        ; Default send start-of-packet char.
  93. DRSOH    EQU    SOH        ; Default receive start-of-packet char.
  94. DSQUOT  EQU     '#'             ; Default send quote char.
  95. DRQUOT  EQU     '#'             ; Default receive quote char.
  96. DQBIN    EQU    '&'        ; Default 8-bit prefix.
  97. DRPT    EQU    '~'        ; Default repeat prefix.
  98. DCHKLEN    EQU    1        ; Default checksum length.
  99. DEFPAR    EQU    PARNON        ; Default parity (none.) 
  100. IBMPAR  EQU    PARMRK        ; IBM's parity (mark.)
  101.  
  102.  
  103. bufsiz    equ    2048        ; size of serial input buffer
  104.  
  105. portmax    equ    8        ; # of serial ports
  106.  
  107. ; baud rate definitions
  108. B00455    EQU    0        ; 45.5 baud
  109. B0050    EQU    1        ; 50 baud
  110. B0075    EQU    2        ; 75 baud
  111. B0110    EQU    3        ; 110 baud
  112. B01345    EQU    4        ; 134.5 baud
  113. B0150    EQU    5        ; 150 baud
  114. B0300    EQU    6        ; 300 baud
  115. B0600    EQU    7        ; 600 baud
  116. B1200    EQU    8        ; 1200 baud
  117. B1800    EQU    9        ; 1800 baud
  118. B2000    EQU    10        ; 2000 baud
  119. B2400    EQU    11        ; 2400 baud
  120. B4800    EQU    12        ; 4800 baud
  121. B9600    EQU    13        ; 9600 baud
  122. B19200    EQU    14        ; 19200 baud
  123. B38400    EQU    15        ; 38400 baud 
  124.  
  125. BAUDSIZ    EQU    16        ; Number of options for baud rate.
  126.  
  127. ; Structure definitions.
  128.  
  129. ; Modem information.
  130. mdminfo    struc
  131. mddat    dw    0        ; Default to port 1.
  132. mdstat    dw    0        ; Ditto. 
  133. mdcom    dw    0        ; Here too. 
  134. mden    db    0
  135. mddis    db    0
  136. mdmeoi    db    0
  137. mdintv    dw    0
  138. mdminfo    ends
  139.  
  140. ; Command information.
  141. cmdinfo    struc    
  142. cmstat  db      0               ; What is presently being parsed.
  143. cmaflg  db      0               ; Non-zero when an action char has been found.
  144. cmccnt  db      0               ; Non-zero if a significant char is found.
  145. cmsflg  db      0               ; Non-zero when the last char was a space.
  146. cmostp  dw      0               ; Old stack pointer for reparse.
  147. cmrprs  dw      0               ; Address to go to on reparse.
  148. cmprmp  dw      0               ; Address of prompt.
  149. cmptab  dw      0               ; Address of present keyword table.
  150. cmhlp   dw      0               ; Address of present help.
  151. cmdbuf  db      80H DUP(0)      ; Buffer for command parsing.
  152. cmfcb   dw      0               ; Pointer to FCB.
  153. cmfcb2  dw      0               ; Pointer to position in FCB.
  154. cmcptr  dw      0               ; Pointer for next char input.
  155. cmdptr  dw      0               ; Pointer into the command buffer.
  156. cmsiz    dw    0        ; Size info of user input.
  157. cmkptr  dw      0               ; Pointer to keyword.
  158. cmsptr  dw      0               ; Place to save a pointer.
  159. cmchr    db    0        ; Save char when checking ambiguity.
  160. cmrflg    db    0        ; Assume parsing filename for send.
  161. cmcr    db    0        ; Say whether bare CR is allowed.
  162. cmquiet    db    0        ; non-zero for no echoing...
  163. cmdinfo    ends
  164.  
  165. ; Flags information.
  166. flginfo    struc
  167. belflg    db    1        ; Use bell
  168. comflg    db    1        ; Use COM1 by default.
  169. abfflg    db    1        ; Discard incoming file if abort.
  170. debug    db    0        ; Debugging mode (default off).
  171. flwflg  db      1               ; File warning flag (default on).
  172. ibmflg  db      0               ; IBM flag (default off).
  173. extflg  db      0               ; Exit flag (default off).
  174. vtflg    db    1        ; H-19 emulation.
  175. droflg    db    0        ; Override default disk drive.
  176. nmoflg    db    0        ; Override name from the F packet.
  177. wldflg    db    0        ; Assume no "*" in fn.
  178. cxzflg    db    0        ; ¬X/¬Z to interrupt file x-fer.
  179. xflg    db    0        ; Seen "X" packet.
  180. filflg  db      0               ; Non-zero when nothing in DMA buffer.
  181. eoflag  db      0               ; EOF flag; non-zero on EOF.
  182. getflg    db    0        ; Assume normal RECEIVE (not GET).
  183. capflg    db    0        ; On if capturing data.
  184. takflg    db    0        ; On if echo commands of TAKE file.
  185. timflg    db    0        ; Say if are timing out or not.
  186. destflg    db    1        ; Incoming files destination: disk or printer.
  187. eofcz    db    0        ; ¬Z signals eof if non-zero.
  188. remflg    db    0        ; non-zero if in remote mode.
  189. modflg    db    1        ; non-zero if mode line on.
  190. wrpflg    db    0        ; non-zero if line wrap is to be done
  191. flginfo    ends
  192.  
  193. ; Transmission parameters
  194. trinfo    struc
  195. maxdat    db    0        ; Max packet size for send.
  196. chklen    db    1        ; Number of characters in checksum.
  197. seol    db    dseol        ; Send EOL char.
  198. reol    db    dreol        ; Receive EOL char.
  199. ssoh    db    dssoh        ; Send start-of-packet character.
  200. rsoh    db    drsoh        ; Receive start-of-packet character.
  201. squote  db    dsquot        ; Send quote character.
  202. rquote    db    drquot        ; Receive quote character.
  203. spsiz    db    dspsiz        ; Send packet size.
  204. rpsiz    db    drpsiz        ; Receive packet size.
  205. stime    db    dstime        ; Send timeout. (Don't timeout).
  206. rtime    db    drtime        ; Receive timeout.
  207. spad    db    dspad        ; Send padding.
  208. rpad    db    drpad        ; Receive padding.
  209. spadch    db    dspadc        ; Send padding char.
  210. rpadch    db    drpadc        ; Receive padding char.
  211. ebquot    db    'Y'        ; Send 8-bit quote character.
  212. escchr    db    defesc        ; Escape character.
  213. trinfo    ends
  214.  
  215. pktinfo    struc
  216. pktnum  dw      0               ; Packet number.
  217. numpkt  dw      0               ; Total number of packets sent.
  218. numrtr  dw      0               ; Total number of retries.
  219. numtry  db      0               ; Number of tries on this packet.
  220. oldtry  db      0               ; Number of tries on previous packet.
  221. state   db      0               ; Present state of the automaton.
  222. argblk  dw      0               ; For subroutine arguments.
  223. argbk1  dw      0
  224. argbk2  dw      0
  225. argbk3  dw      0
  226. pktinfo    ends
  227.  
  228. takinfo    struc
  229. takfcb    db    fcbsiz dup(0)
  230. takbuf    db    dmasiz dup(0)
  231. takptr    dw    0
  232. takchl    db    0
  233. takcnt    dw    0,0
  234. takinfo ends
  235.  
  236. ; Port Information.
  237. prtinfo    struc
  238. baud    dw    0        ; Default baud rate.
  239. ecoflg  db      0               ; Local echo flag (default off).
  240. parflg  db    0        ; Parity flag (default none.)
  241. floflg    db    0        ; If need flow control during file x-fer.
  242. hndflg    db    0        ; If need handshake during file x-fer.
  243. hands    db    0        ; Default handshake.
  244. flowc    dw    0        ; Do flow control with XON/XOFF.
  245. prtinfo    ends
  246.  
  247. mkeyw    macro    key,val
  248.     local    junk,oldval
  249. oldval    equ    $
  250.     db    junk,key,'$'
  251. junk    equ    $-oldval-2
  252.     dw    val
  253.     endm
  254.  
  255.  
  256. ; definitions for terminal handler:
  257.  
  258. termarg    struc
  259. flgs    db    ?        ; flags
  260. prt    db    ?        ; port to use (0,1)
  261. cols    db    ?        ; # columns on screen
  262. rows    db    ?        ; # rows on screen
  263. captr    dw    ?        ; routine to call with captured data
  264. belld    dw    ?        ; bell divisor
  265. klen    dw    ?        ; length of key redefinition table
  266. ktab    dw    ?        ; address of key redefinition table
  267. krpl    dw    ?        ; address of key replacement table
  268. escc    db    ?        ; escape character
  269. baudb    db    ?        ; baud rate bits.
  270. parity    db    ?        ; parity
  271. termarg    ends
  272.  
  273. ; bits for flag byte
  274. scrsam    equ    80h            ; on if shouldn't redraw screen
  275. capt    equ    40h            ; capture output
  276. emheath    equ    20h            ; emulate heath
  277. havtt    equ    10h            ; have translate table
  278. trnctl    equ    08h            ; translate control chars
  279. modoff    equ    04h            ; mode line off
  280. lnwrap    equ    02h            ; auto-wrap long lines
  281. lclecho    equ    01h            ; local echo
  282.  
  283. ; macro to save registers...
  284.  
  285. saveac    macro    regs
  286.     local    cnt,lbl,xcnt
  287. cnt    =    0
  288.     irp    reg,<regs>
  289.     push    reg
  290. cnt    =    cnt+1
  291.     endm
  292.     call    lbl
  293.     mov    bp,sp
  294. xcnt    =    cnt
  295.     irp    reg,<regs>
  296. cnt    =    cnt-1
  297.     mov    reg,[bp+2*cnt]
  298.     endm
  299.     mov    bp,ax        ; store ax temporarily
  300.     lahf            ; preserve flags
  301.     add    sp,2*xcnt
  302.     sahf
  303.     mov    ax,bp        ; restore ax
  304.     ret
  305. lbl    label    near
  306.     endm
  307.  
  308.  
  309.